<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>年度对账单</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="../../../js/angular.js"></script>
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<script type="text/javascript" src="../../../layui/lay/modules/layer.js"></script>
<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
<script src="../../../layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="../../../dwwsyyt/dw/gjjhbj/fy.js"></script>
<style>
         .layui-form-label{
         	 text-align: left;
             width:130px;
             height:30px;

     }
</style>
</head>
<body>
    <fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 30px;">
		<legend>年度对账单</legend>
	</fieldset>
	<div ng-app="myApp" ng-controller="customersCtrl" align="center">
		<label class="layui-form-label"></label>
		<div class="layui-input-block" align="center">
			<select id="nian" name="interest" lay-filter="aihao"style="width:20%;">
				<option value="" id="qb"selected="selected"></option>
				<option value="" id="n1"></option>
				<option value="" id="n2"></option>
				<option value="" id="n3"></option>
			</select> <input type="button" id="ck" value="查&nbsp;&nbsp;&nbsp;询" style="width:10%;" ng-click="cx()">
		</div>

		<form class="layui-form" action="">
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">姓名:</label>
					<div class="layui-input-inline">
						<input type="text" id="XINGMING" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">个人账号:</label>
					<div class="layui-input-inline">
						<input type="text" id="GRZH" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">证件号码:</label>
					<div class="layui-input-inline">
						<input type="text" id="ZJHM" autocomplete="off"
							class="layui-input">
					</div>
				</div>

			</div>

			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">缴存开始日期:</label>
					<div class="layui-input-inline">
						<input type="text" id="JCKSRQ" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">个人账户余额:</label>
					<div class="layui-input-inline">
						<input type="text" id="GRZHYE" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">个人账户上年结转余额:</label>
					<div class="layui-input-inline">
						<input type="text" id="GRZHSNJZYE" autocomplete="off"
							class="layui-input">
					</div>
				</div>

			</div>

			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">缴存总金额:</label>
					<div class="layui-input-inline">
						<input type="text" id="JCZJE" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">本年缴存金额:</label>
					<div class="layui-input-inline">
						<input type="text" id="BNJCJE" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">合同贷款金额:</label>
					<div class="layui-input-inline">
						<input type="text" id="HTDKJE" autocomplete="off"
							class="layui-input">
					</div>
				</div>

			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">剩余本金:</label>
					<div class="layui-input-inline">
						<input type="text" id="SYBJ" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">提取金额:</label>
					<div class="layui-input-inline">
						<input type="text" id="TQJE" autocomplete="off"
							class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">提取次数:</label>
					<div class="layui-input-inline">
						<input type="text" id="TQCS" autocomplete="off"
							class="layui-input">
					</div>
				</div>
			</div>
		</form>
		<table class="layui-hide" id="LAY_table_user" lay-filter="user"></table>
	<div><loading>查询中请稍后</loading>  
		<table class="layui-table" style="width:90%">
			<tr align="center" style="background-color:#f1f1f1">
				<td>个人账号</td>
				<td>日期</td>
				<td>本期归集额</td>
				<td>提取额金额</td>
				<td>余额</td>
				<td>利息合计</td>
				<td>缴存金额</td>
			</tr>
			<tr ng-repeat="x in names" align="center">
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.GRZH }}</td>
				<td ng-if="$even">{{ x.GRZH }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.RQ }}</td>
				<td ng-if="$even">{{ x.RQ }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.BQGJE}}</td>
				<td ng-if="$even">{{ x.BQGJE }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.TQEJE }}</td>
				<td ng-if="$even">{{ x.TQEJE }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.YE }}</td>
				<td ng-if="$even">{{ x.YE }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.LXHJ }}</td>
				<td ng-if="$even">{{ x.LXHJ }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.JCJE }}</td>
				<td ng-if="$even">{{ x.JCJE }}</td>
			</tr>
		</table>
	</div>
		<div class="layui-btn-group">
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Sy()">首页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Previous()">上一页</button>
			<button ng-repeat="page in pageList" class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="selectPage(page)">{{ page }}</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Next()">下一页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Wy()">尾页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm "
				>{{selPage}}/{{pages}}</button>
		</div>

	</div>
	<script>
		layui.use('element', function() {
			var $ = layui.jquery, element = layui.element;
		});
	</script>
	<script type="text/javascript">
	
	function getPath() {  
	     
	        return 'http://'+location.host;
	}
		
		
	</script>
	<script type="text/javascript" src="../../../layui/lay/modules/layer.js"></script>
	<script type="text/javascript" src="../../../layui/layer.ext.js"></script>
	<script>
			$(function(){
				var myDate = new Date;
				var year = myDate.getFullYear();
				
				var num1=year-1;
				var num2=year-2;
				var num3=year-3;
				$("#n1").val(num1);
				$("#n1").html(num1);
				$("#n2").val(num2);
				$("#n2").html(num2);
				$("#n3").val(num3);
				$("#n3").html(num3);
				$("#qb").val("");
				$("#qb").html("全部信息");
			});
			$(function(){
				$.ajax({
					url : getPath()+'/wsyyt/nddzdcontroller/test1',
					method : 'post',
					dataType : 'JSON',
					success : function(result) {
						var data = result.data;//这边的data属性是object
						if(result.code==0){
							$.each(data, function(key, value) {
								$("#" + key).val(value);
							});
						}else{
							layer.msg('提示：'+result.CW,{icon: 5});	
						}
					},
				});
			});
			$("#ck").click(function(){
			var n=$("#nian").val();
			$.ajax({
					url : getPath()+'/wsyyt/nddzdcontroller/test1',
					method : 'post',
					dataType : 'JSON',
					data: {'ny':n},
					success : function(result) {
						var data = result.data;//这边的data属性是object
						if(result.code==0){
							$.each(data, function(key, value) {
								$("#" + key).val(value);
							});
						}else{
							layer.msg('提示：'+result.CW,{icon: 5});	
						}
					}
				});
			});
	    </script>
	<script>
			var a;
			var app = angular.module('myApp', []);
			 app.directive('loading', function(){  
		        return {  
		            restrict: 'E',  
		            transclude: true,  
		            template: '<div ng-show="loading" class="loading" id="allDiv"  style="position:fixed; top:0px; left:0px; width:100%; height:100%; display:none; background-color:#000; opacity: 0.5; z-index:99999;">'  
		            +'<img alt="" src="../../../layui/img/jz.gif" style="vertical-align: middle;width:30px; height:30px; position: absolute; top:50%; left:50%; margin-top: -50px; margin-left:-50px;"/>'
		            +'</div>',  
		            link: function (scope, element, attr) {  
		                scope.$watch('loading', function (val) {  
		                    if (val){  
		                        document.getElementById("allDiv").style.display = "block";  
		                    }else{  
		                        document.getElementById("allDiv").style.display = 'none';  
		  
		                    }  
		                });  
		            }  
		        };
		    });  
		    app.controller('customersCtrl', function($scope, $http) {
		    $scope.setLoading =function(){  
			    if($scope.loading ==undefined || $scope.loading ==false){  
			        $scope.loading=true;  
			    }else{  
			        $scope.loading=false;  
			    };
			};
		     $scope.cx = function () {
		     	$scope.setLoading();
      			$scope.params={n:$("#nian").val()};
			$http({
				url:getPath() + "/wsyyt/nddzdcontroller/test",
				method:'post',
				params:$scope.params
				
			}).then(function(res) {
								$scope.data = res.data.data.RETDATA;//自己打断点看格式:[{},{}]
								$scope.setLoading();
									if(res.data.code==1){
										$scope.names="";
										$scope.selPage="";
										$scope.selectPage="";
										$scope.pages="";
										$scope.page="";
										$scope.pageList="";
										layer.msg('提示：'+res.data.CW,{icon: 5});		
										return null;	
									}
						a = res.data.CNT;
						feny($scope.data);	
						});
				};
		});
	</script>
</body>
</html>
